////#include <stdio.h>
////#include <stdlib.h>
////
////typedef int ElementType;
////typedef struct Node *PtrToNode;
////struct Node {
////    ElementType Data;
////    PtrToNode   Next;
////};
////typedef PtrToNode List;
////
////List Read(); /* 细节在此不表 */
////void Print( List L ); /* 细节在此不表 */
////
////List Insert( List L, ElementType X );
////
////int main()
////{
////    List L;
////    ElementType X;
////    L = Read();
////    scanf("%d", &X);
////    L = Insert(L, X);
////    Print(L);
////    return 0;
////}
////
/////* 你的代码将被嵌在这里 */
////
////
////
////List Insert( List L, ElementType X ){
////    List p=L;
////    List pre=p;
////    while (pre->Next != NULL ){
////        if(pre -> Next->Data >= X){
////            break;
////        }
////        pre=pre->Next;
////    }
////    List tmp=(List)malloc(sizeof(struct Node));
////    tmp->Next=NULL;
////    tmp->Data=X;
////    tmp->Next=pre->Next;
////    pre->Next=tmp;
////    return p;
////}
////
////void Print( List L ){
////    List p =L;
////    while (p->Next!= NULL){
////        printf("%d",p->Data);
////        p = p->Next;
////    }
////}
////#include <stdio.h>
////
////#define MAXSIZE 20
////typedef int ElementType;
////
////typedef int Position;
////typedef struct LNode *List;
////struct LNode {
////    ElementType Data[MAXSIZE];
////    Position Last; /* 保存线性表中最后一个元素的位置 */
////};
////
////List ReadInput(); /* 裁判实现，细节不表。元素从下标0开始存储 */
////void PrintList( List L ); /* 裁判实现，细节不表 */
////List Delete( List L, ElementType minD, ElementType maxD );
////
////int main()
////{
////    List L;
////    ElementType minD, maxD;
////    int i;
////
////    L = ReadInput();
////    scanf("%d %d", &minD, &maxD);
////    L = Delete( L, minD, maxD );
////    PrintList( L );
////
////    return 0;
////}
////
/////* 你的代码将被嵌在这里 */
////
////List Delete( List L, ElementType minD, ElementType maxD ){
////
////    Position rear=0;
////    Position i;
////    for(i=0;i<L->Last+1;i++){
////        if(L->Data[i]<=minD ||L->Data[i]>=maxD){
////            L->Data[rear++]=L->Data[i];
////        }
////    }
////    L->Last=rear-1;
////    return L;
////}
//
//#include <stdio.h>
//#include <stdlib.h>
//
//#define ERROR NULL
//typedef enum {false, true} bool;
//typedef int ElementType;
//typedef struct LNode *PtrToLNode;
//struct LNode {
//    ElementType Data;
//    PtrToLNode Next;
//};
//typedef PtrToLNode Position;
//typedef PtrToLNode List;
//
//List MakeEmpty();
//Position Find( List L, ElementType X );
//bool Insert( List L, ElementType X, Position P );
//bool Delete( List L, Position P );
//
//int main()
//{
//    List L;
//    ElementType X;
//    Position P;
//    int N;
//    bool flag;
//
//    L = MakeEmpty();
//    scanf("%d", &N);
//    while ( N-- ) {
//        scanf("%d", &X);
//        flag = Insert(L, X, L->Next);
//        if ( flag==false ) printf("Wrong Answer\n");
//    }
//    scanf("%d", &N);
//    while ( N-- ) {
//        scanf("%d", &X);
//        P = Find(L, X);
//        if ( P == ERROR )
//            printf("Finding Error: %d is not in.\n", X);
//        else {
//            flag = Delete(L, P);
//            printf("%d is found and deleted.\n", X);
//            if ( flag==false )
//                printf("Wrong Answer.\n");
//        }
//    }
//    flag = Insert(L, X, NULL);
//    if ( flag==false ) printf("Wrong Answer\n");
//    else
//        printf("%d is inserted as the last element.\n", X);
//    P = (Position)malloc(sizeof(struct LNode));
//    flag = Insert(L, X, P);
//    if ( flag==true ) printf("Wrong Answer\n");
//    flag = Delete(L, P);
//    if ( flag==true ) printf("Wrong Answer\n");
//    for ( P=L->Next; P; P = P->Next ) printf("%d ", P->Data);
//    return 0;
//}
///* 你的代码将被嵌在这里 */
//
//List MakeEmpty(){
//    List list=(List) malloc(sizeof(struct LNode));
//    list->Next=NULL;
//    return list;
//}
//
//Position Find( List L, ElementType X ){
//    PtrToLNode ptr = L;
//    while(ptr-> Next != NULL){
//        if (ptr->Next->Data == X){
//            return ptr->Next;
//        }
//        ptr = ptr -> Next;
//    }
//    return ERROR;
//}
//
//bool Insert( List L, ElementType X, Position P ){
//    PtrToLNode ptr = L;
//    while(ptr-> Next != NULL){
//        if (ptr->Next == P){
//            break;
//        }
//        ptr = ptr -> Next;
//    }
//    if (ptr -> Next == P){
//        PtrToLNode tmp=(PtrToLNode) malloc(sizeof(struct LNode));
//        tmp->Data=X;
//        tmp->Next=P;
//        ptr->Next=tmp;
//        return true;
//    } else{
//        printf("Wrong Position for Insertion\n");
//        return false;
//    }
//}
//
//bool Delete( List L, Position P ){
//    PtrToLNode ptr = L;
//    while(ptr-> Next != NULL){
//        if (ptr->Next == P){
//            break;
//        }
//        ptr = ptr -> Next;
//    }
//    if (ptr -> Next == NULL){
//        printf("Wrong Position for Deletion\n");
//        return false;
//    }
//    ptr->Next=P->Next;
//    P->Next=NULL;
//    free(P);
//    return true;
//}
